<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>wwwApp: page.php Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">wwwApp
   </div>
   <div id="projectbrief">A web app for workshop organizing, recruitment and qualification</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">page.php</div>  </div>
</div><!--header-->
<div class="contents">
<a href="page_8php.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;&lt;?php</div>
<div class="line"><a name="l00002"></a><span class="lineno"><a class="code" href="classPage.html">    2</a></span>&#160;<span class="keyword">class </span><a class="code" href="classPage.html">Page</a> <span class="keyword">extends</span> <a class="code" href="classSimpleTemplate.html">SimpleTemplate</a></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;{</div>
<div class="line"><a name="l00004"></a><span class="lineno"><a class="code" href="classPage.html#a7c663964262245f2ca7b7034b4f0d4f6">    4</a></span>&#160;        <span class="keyword">function</span> <a class="code" href="classPage.html#a7c663964262245f2ca7b7034b4f0d4f6">__construct</a>()</div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;        {</div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;                <a class="code" href="classPage.html#a7c663964262245f2ca7b7034b4f0d4f6">parent::__construct</a>();</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;                $this-&gt;head = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;                $this-&gt;title = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;                $this-&gt;menu = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;                $this-&gt;content = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;                $this-&gt;topContent = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;                $this-&gt;js = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;                $this-&gt;jsOnLoad = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;        }</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;</div>
<div class="line"><a name="l00016"></a><span class="lineno"><a class="code" href="classPage.html#a1960af93d393797b21b8b895f2fb3ff1">   16</a></span>&#160;        <span class="keyword">function</span> <a class="code" href="classPage.html#a1960af93d393797b21b8b895f2fb3ff1">finish</a>($translated = <span class="keyword">false</span>)</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;        {</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;                header(<span class="stringliteral">&#39;Content-Language: pl&#39;</span>);</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;                header(<span class="stringliteral">&#39;Content-Type: text/html; charset=UTF-8&#39;</span>);</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;                <span class="comment">// Too frequent version changes make things incompatible. Must-revalidate.</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;                <span class="comment">// May be changed to something less expensive later.</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;                header(<span class="stringliteral">&#39;Cache-Control: private, s-maxage=0, max-age=0, must-revalidate&#39;</span>);</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;                header(<span class="stringliteral">&#39;Last-Modified: &#39;</span>. gmdate(<span class="stringliteral">&quot;D, d M Y H:i:s&quot;</span>, time()) .<span class="stringliteral">&#39; GMT&#39;</span>);</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;                <span class="keywordflow">if</span> (DEBUG&gt;=2) $this-&gt;content .= <a class="code" href="error_8php.html#a9eb4c4183b3422da2c46809ba4cd7244">dumpSuperGlobals</a>();</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;                <span class="comment">//$this-&gt;latexPath = &#39;http://&#39;. $_SERVER[&#39;HTTP_HOST&#39;] . &#39;/cgi-bin/mimetex.cgi&#39;;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;                $this-&gt;latexPath = <span class="stringliteral">&#39;http://latex.codecogs.com/gif.latex?&#39;</span>;</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;                $this-&gt;uploadGetter = <span class="stringliteral">&#39;http://&#39;</span>. $_SERVER[<span class="stringliteral">&#39;HTTP_HOST&#39;</span>] . <span class="stringliteral">&#39;/uploader/getfile.php&#39;</span>;</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;                <span class="keywordflow">if</span> (!isset($this-&gt;headerTitle))</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;                        $this-&gt;headerTitle = <span class="stringliteral">&#39;&lt;h2&gt;&#39;</span>. $this-&gt;title .<span class="stringliteral">&#39;&lt;/h2&gt;&#39;</span>;</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;                <span class="keywordflow">if</span> (!isset($_GET[<span class="stringliteral">&#39;print&#39;</span>]))</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;                        include(<span class="stringliteral">&#39;html.php&#39;</span>);</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;                <span class="keywordflow">else</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;                        $this-&gt;<a class="code" href="classPage.html#a73078e3540a198b057eaf5c64c583410">printableHTML</a>();</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classPage.html#a1960af93d393797b21b8b895f2fb3ff1">parent::finish</a>();</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;        }</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="code" href="classPage.html#a7e5668d927e99dc60f648f520c117f6d">   41</a></span>&#160;        <span class="keyword">function</span> <a class="code" href="classPage.html#a7e5668d927e99dc60f648f520c117f6d">addMessage</a>($text, $type=<span class="stringliteral">&#39;unknown&#39;</span>)</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;        {</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;                $icons = array(</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;                        <span class="stringliteral">&#39;info&#39;</span> =&gt; <span class="stringliteral">&#39;information.png&#39;</span>,</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;                        <span class="stringliteral">&#39;warning&#39;</span> =&gt; <span class="stringliteral">&#39;error.png&#39;</span>,</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;                        <span class="stringliteral">&#39;success&#39;</span> =&gt; <span class="stringliteral">&#39;accept.png&#39;</span>,</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;                        <span class="stringliteral">&#39;instruction&#39;</span> =&gt; <span class="stringliteral">&#39;pencil.png&#39;</span>,</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;                        <span class="stringliteral">&#39;userError&#39;</span> =&gt; <span class="stringliteral">&#39;exclamation.png&#39;</span>,</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;                        <span class="stringliteral">&#39;exception&#39;</span> =&gt; <span class="stringliteral">&#39;cancel.png&#39;</span>,</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;                );</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;                <span class="keywordflow">if</span> (isset($icons[$type]))</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;                {</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;                        $src = <a class="code" href="config_8php_8template.html#a2344febf266e5f02233a920c7961b0f1">ABSOLUTE_PATH_PREFIX</a> .<span class="stringliteral">&#39;images/fatcow/32/&#39;</span>. $icons[$type];</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;                        $text = <span class="stringliteral">&quot;&lt;img src=&#39;$src&#39; alt=&#39;$type&#39;/&gt;$text&quot;</span>;</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;                }</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;                $this-&gt;topContent .= <span class="stringliteral">&quot;&lt;div class=&#39;contentBox message&#39;&gt;$text&lt;/div&gt;&quot;</span>;</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        }</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        <span class="comment">// $items is an array of menu items: each as an associative array or</span></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        <span class="comment">//      a vector with &#39;title&#39;,&#39;action&#39;,&#39;icon&#39;[,&#39;perm&#39;] values respectively.</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="classPage.html#a9a9881694a8b4385a67363db45854c61">   62</a></span>&#160;        <span class="keyword">function</span> <a class="code" href="classPage.html#a9a9881694a8b4385a67363db45854c61">addMenuBox</a>($title, $items, $custom=<span class="stringliteral">&#39;&#39;</span>)</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        {</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;                $count = 0;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;                $menuItems = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;                <span class="keywordflow">foreach</span> ($items as $item)</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;                {</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;                        <span class="keywordflow">if</span> (!isset($item[<span class="stringliteral">&#39;perm&#39;</span>]))</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;                                $item[<span class="stringliteral">&#39;perm&#39;</span>] = <a class="code" href="user_2utils_8php.html#a1e9c8ed2c5ed2def1a367c9ffd04114b">userCan</a>($item[<span class="stringliteral">&#39;action&#39;</span>]);</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;                        <span class="keywordflow">if</span> (!$item[<span class="stringliteral">&#39;perm&#39;</span>])</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;                                <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;                        $count++;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;                        $item[<span class="stringliteral">&#39;icon&#39;</span>] = empty($item[<span class="stringliteral">&#39;icon&#39;</span>]) ? <span class="stringliteral">&#39;&#39;</span> : <a class="code" href="template_8php.html#a4fbd311bbd72b7beba6f27fe63b0acb1">getIcon</a>($item[<span class="stringliteral">&#39;icon&#39;</span>]);</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;                        $menuItems .= <a class="code" href="template_8php.html#a93341043d3d499b0d03eb7ebbe39fdaf">formatAssoc</a>(<span class="stringliteral">&#39;&lt;li&gt;%icon% &lt;a href=&quot;%action%&quot;&gt;%title%&lt;/a&gt;&lt;/li&gt;&#39;</span>, $item);</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;                }</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;                <span class="keywordflow">if</span> (!$count)  <span class="keywordflow">return</span> <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;                $params = array(<span class="stringliteral">&#39;title&#39;</span>=&gt;$title,<span class="stringliteral">&#39;items&#39;</span>=&gt;$menuItems,<span class="stringliteral">&#39;custom&#39;</span>=&gt;$custom);</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;                $template = <span class="keyword">new</span> <a class="code" href="classSimpleTemplate.html">SimpleTemplate</a>($params);</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;                ?&gt;</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;                        &lt;div <span class="keyword">class</span>=<span class="stringliteral">&quot;menuBox&quot;</span>&gt;</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;                                %custom%</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;                                &lt;h3&gt;%title%&lt;/h3&gt;</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;                                &lt;ul&gt;%items%&lt;/ul&gt;</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;                        &lt;/div&gt;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;                &lt;?php</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;                $this-&gt;menu .= $template-&gt;finish();</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;        }</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;</div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="code" href="classPage.html#a73078e3540a198b057eaf5c64c583410">   90</a></span>&#160;        <span class="keyword">function</span> <a class="code" href="classPage.html#a73078e3540a198b057eaf5c64c583410">printableHTML</a>()</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        {</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;                ?&gt;&lt;!DOCTYPE html PUBLIC <span class="stringliteral">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span class="stringliteral">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span>&gt;</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;                        &lt;html xmlns=<span class="stringliteral">&quot;http://www.w3.org/1999/xhtml&quot;</span> xml:lang=<span class="stringliteral">&quot;pl&quot;</span> lang=<span class="stringliteral">&quot;pl&quot;</span> dir=<span class="stringliteral">&quot;ltr&quot;</span>&gt;</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;                        &lt;head&gt;</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;                                &lt;meta http-equiv=<span class="stringliteral">&quot;Content-Type&quot;</span> content=<span class="stringliteral">&quot;text/html; charset=utf-8&quot;</span> /&gt;</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;                                &lt;link rel=<span class="stringliteral">&quot;stylesheet&quot;</span> type=<span class="stringliteral">&quot;text/css&quot;</span> href=<span class="stringliteral">&quot;&lt;?php writeMTime(&#39;css.css&#39;); ?&gt;&quot;</span> /&gt;</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;                                &lt;title&gt;%title% - WWW&lt;/title&gt;</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;                        &lt;/head&gt;</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;                        &lt;body <span class="keyword">class</span>=<span class="stringliteral">&quot;printable&quot;</span>&gt;</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;                                &lt;div&gt;</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;                                        %topContent%</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;                                        %headerTitle%</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;                                        %content%</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;                                &lt;/div&gt;</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;                        &lt;/body&gt;</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;                        &lt;/html&gt;</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;                &lt;?php</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;        }</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Sep 8 2013 17:44:57 for wwwApp by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.1
</small></address>
</body>
</html>
